<template>
	<div class="bigDiv">
		<el-form ref="searchForm" :model="queryParams" :inline="true" label-width="88px">
			<div class="topNav">
				<el-button type="text" @click="passAll" v-hasPermi="['Supper_Admin']">批量上架</el-button>
				<el-button icon="el-icon-search" type="text" @click="handleQuery" style="float:right;">搜索</el-button>
				<el-button icon="el-icon-refresh" @click="resetQuery" type="text" style="float:right;">重置</el-button>
			</div>
			<el-form-item label="商品名" prop="goodsName">
				<el-input v-model="queryParams.goodsName" placeholder="商品名" clearable size="small"
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="sku" prop="sku">
				<el-input v-model="queryParams.sku" placeholder="sku" clearable size="small"
					@keyup.enter.native="handleQuery" />
			</el-form-item>
			<el-form-item label="供应商" prop="supplierId">
				<el-select size="small" v-model="queryParams.supplierId" @change="changeSupplier" placeholder="请输入关键词搜索"
					filterable clearable>
					<el-option v-for="item in supplierList" :key="item.supplierId" :label="item.supplierName"
						:value="item.supplierId">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="审批状态" prop="activityStatus">
				<el-select size="small" v-model="queryParams.activityStatus" placeholder="请选择" filterable clearable>
					<el-option v-for="item in activityFilters" :key="item.value" :label="item.text" :value="item.value">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="上架状态" prop="activityStatus">
				<el-select size="small" v-model="queryParams.goodsState" placeholder="请选择" filterable clearable>
					<el-option label="上架" value="PASS"> </el-option>
					<el-option label="下架" value="DOWN"> </el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="商品来源" prop="activityStatus">
				<el-select size="small" v-model="queryParams.goodsSource" placeholder="请选择" filterable clearable>
					<el-option v-for="item in goodsSourceFilters" :key="item.value" :label="item.text"
						:value="item.value">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="品牌名称" prop="brandId">
				<el-select v-model="queryParams.brandId" filterable remote size="small" :remote-method="remoteMethod"
					@change="changeBrand" placeholder="请输入关键词搜索">
					<el-option v-for="item in brandList" :key="item.id" :label="item.nameShow"
						:value="item.id">{{ item.nameShow }}</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="一级分类" prop="primaryCategory">
				<el-select v-model="queryParams.primaryCategory" size="small" filterable
					@change="changePrimaryCategory">
					<el-option v-for="item in primaryCategory" :key="item.id" :label="item.categoryName"
						:value="item.id">{{ item.categoryName }}
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="二级分类" prop="secondaryCategory">
				<el-select v-model="queryParams.secondaryCategory" size="small" filterable
					@change="changeSecondaryCategory">
					<el-option v-for="item in secondaryCategory" :key="item.id" :label="item.categoryName"
						:value="item.id">
						{{ item.categoryName }}
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="三级分类" prop="tertiaryCategory">
				<el-select v-model="queryParams.tertiaryCategory" size="small" filterable
					@change="changeTertiaryCategory">
					<el-option v-for="item in tertiaryCategory" :key="item.id" :label="item.categoryName"
						:value="item.id">
						{{ item.categoryName }}
					</el-option>
				</el-select>
			</el-form-item>
		</el-form>
		<div style="margin-top: 20px" v-show="queryParams.supplierId">
			<el-popconfirm confirm-button-text="确定" cancel-button-text="取消" icon="el-icon-info" icon-color="red"
				title="确定批量下架商品？" @confirm="handleBatchDowm()">
				<el-button slot="reference" type="primary" size="mini">批量下架</el-button>
			</el-popconfirm>
		</div>
		<el-table ref="goodsTable" v-loading="loading" :data="list" @selection-change="handleSelectionChange" height="calc(100vh - 380px)">
			<el-table-column type="selection" width="55"> </el-table-column>
			<el-table-column label="商品名称" align="center" prop="goodsName" width="250">
				<template slot-scope="scope">
					<el-tooltip :content="scope.row.goodsName" placement="bottom" effect="dark" class="goodsNameBox">
						<div>{{ scope.row.goodsName }}</div>
					</el-tooltip>
				</template>
			</el-table-column>
			<el-table-column label="sku" align="center" prop="sku" width="200">
				<template slot-scope="scope">
					<el-tooltip :content="scope.row.sku" placement="bottom" effect="dark" class="goodsNameBox">
						<div>{{ scope.row.sku }}</div>
					</el-tooltip>
				</template>
			</el-table-column>
			<el-table-column label="品牌" align="center" prop="brandName" width="200">
				<template slot-scope="scope">
					<el-tooltip :content="scope.row.brandName" placement="bottom" effect="dark" class="goodsNameBox">
						<div>{{ scope.row.brandName }}</div>
					</el-tooltip>
				</template>
			</el-table-column>
			<el-table-column label="商品分类" align="center" width="350">
				<template slot-scope="scope">
					{{ scope.row.primaryCategoryName || "" }}
					<span class="divider">/</span>
					{{ scope.row.secondaryCategoryName || "" }}
					<span class="divider">/</span>
					{{ scope.row.tertiaryCategoryName || "" }}
				</template>
			</el-table-column>
			<el-table-column label="库存" align="center" prop="goodsStock">
				<template slot-scope="scope">
					<el-input-number type="number" v-model="scope.row.goodsStock" style="width: 100%" @change="
              (currentValue, oldValue) => {
                changeStock(scope.row, currentValue, oldValue);
              }
            " size="mini" :controls="false" />
				</template>
			</el-table-column>
			<el-table-column label="是否上架" align="center" prop="goodsState">
				<template slot-scope="scope">
					<span :class="scope.row.goodsState == 'DOWN' ? 'false' : 'true'" @click="handleDown(scope.row)">
						{{ scope.row.goodsState == "DOWN" ? "下架" : "上架" }}
					</span>
				</template>
			</el-table-column>
			<el-table-column label="审批状态" align="center" prop="activityStatus" width="150">
				<template slot-scope="scope">
					<span v-if="scope.row.activityStatus == 0">
						{{
              userList[scope.row.primaryCategory]
                ? userList[scope.row.primaryCategory].name + "-审批"
                : "分类错误"
            }}
					</span>
					<span v-else-if="scope.row.activityStatus == -1" class="true">
						违规商品
					</span>
					<span v-else :class="scope.row.activityStatus == 2 ? 'true' : 'false'">
						{{
              activityStatus[scope.row.activityStatus] ||
              scope.row.activityStatus
            }}
					</span>
					<br />
					<template v-if="scope.row.activityStatus == 2">
						<el-button size="mini" type="text" @click="handleShowActivity(scope.row)">
							查看原因
						</el-button>
					</template>
					<template v-else-if="scope.row.activityStatus == 0">
						<el-button size="mini" type="text" @click="handleGoodsFail(scope.row)"
							v-hasPermi="['adminGoodsReject']">
							驳回
						</el-button>
					</template>
				</template>
			</el-table-column>
			<el-table-column label="优采销售价(元)" align="center" prop="goodsPrice" width="88">
				<template slot-scope="scope">
					<span class="price">
						{{ priceCalc(scope.row.goodsPrice) }}
					</span>
				</template>
			</el-table-column>
			<el-table-column label="官网价(元)" align="center" prop="officialPrice">
				<template slot-scope="scope">
					<span class="price">
						{{ scope.row.officialPrice }}
					</span>
				</template>
			</el-table-column>
			<el-table-column label="供应商" align="center" prop="supplierName" width="200">
				<template slot-scope="scope">
					<el-tooltip :content="scope.row.supplierName" placement="bottom" effect="dark" class="goodsNameBox">
						<div>{{ scope.row.supplierName }}</div>
					</el-tooltip>
				</template>
			</el-table-column>
			<el-table-column label="商品来源" align="center" prop="goodsSource" width="200">
				<template slot-scope="scope">
					<span @click="changeGoodsSource(scope.row)">
						{{ goodsSource[scope.row.goodsSource] || "错误" }}
					</span>
				</template>
			</el-table-column>

			<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"
				width="100px">
				<template slot-scope="scope">
					<el-button size="mini" type="text" slot="reference" icon="el-icon-search"
						@click="showInfo(scope.row)">查看详情
					</el-button>

					<el-dropdown trigger="click">
						<span class="el-dropdown-link">
							更多<i class="el-icon-arrow-down el-icon--right"></i>
						</span>
						<el-dropdown-menu slot="dropdown">
							<el-dropdown-item :disabled="scope.row.goodsState == 'DOWN'">
								<el-popconfirm confirm-button-text="下架" cancel-button-text="取消" icon="el-icon-info"
									icon-color="red" title="确定下架商品？" @confirm="handleDown(scope.row)">
									<el-button size="mini" type="text" slot="reference" icon="el-icon-delete">下架
									</el-button>
								</el-popconfirm>
							</el-dropdown-item>
							<el-dropdown-item :disabled="scope.row.activityStatus < 0">
								<el-popconfirm confirm-button-text="拉黑" cancel-button-text="取消" icon="el-icon-info"
									icon-color="red" title="确定拉黑商品？" @confirm="handleDownForever(scope.row)">
									<el-button size="mini" type="text" slot="reference" icon="el-icon-delete">拉黑
									</el-button>
								</el-popconfirm>
							</el-dropdown-item>
						</el-dropdown-menu>
					</el-dropdown>
				</template>
			</el-table-column>
		</el-table>

		<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
			:limit.sync="queryParams.pageSize" @pagination="getList" />

		<el-dialog title="审批记录" :visible.sync="historyVisible" width="80vw">
			<template v-if="rejectInfoForm.length > 0">
				<div v-for="fromData in rejectInfoForm" style="margin: 20px auto; border-top: 1px solid #ddd">
					<div class="historyList historyHead">
						<h3 class="item2">审批节点</h3>
						<h3 class="item2">sku</h3>
						<h3 class="item2">审批时间</h3>
						<h3 class="item2">审批意见</h3>
						<h3 class="item2">审批人</h3>
					</div>
					<div class="historyList">
						<h3 class="item2">
							<el-popover placement="top" trigger="hover">
								<div class="cell-content">项目经理审批</div>
								<p class="overflow" slot="reference">项目经理审批</p>
							</el-popover>
						</h3>
						<h3 class="item2">{{ fromData.sku }}</h3>
						<h3 class="item2">{{ fromData.createTime }}</h3>
						<h3 class="item2">{{ fromData.message }}</h3>
						<h3 class="item2">
							{{ fromData.manager ? fromData.manager.name : "" }}
						</h3>
					</div>
				</div>
			</template>
			<template v-if="fromDataArray.length > 0">
				<div v-for="fromData in fromDataArray" style="margin: 20px auto; border-top: 1px solid #ddd">
					<div class="historyList historyHead">
						<h3 class="item">审批节点</h3>
						<h3 class="item">审批人</h3>
						<h3 class="item">提报人</h3>
						<h3 class="item">审批时间</h3>
						<h3 class="item">审批意见</h3>
						<h3 class="item">审批批注</h3>
					</div>
					<div class="historyList" v-for="(historyData, index) in fromData" :key="index">
						<h3 class="item">
							<el-popover placement="top" trigger="hover">
								<div class="cell-content">{{ historyData.taskNodeName }}</div>
								<p class="overflow" slot="reference">
									{{ historyData.taskNodeName }}
								</p>
							</el-popover>
						</h3>
						<h3 class="item">
							{{ historyData.createBy }}({{ historyData.createName }})
						</h3>
						<h3 class="item">{{ historyData.purchaser }}</h3>
						<h3 class="item">{{ historyData.createdDate }}</h3>
						<div v-for="(
                fistoryFormData, indexH
              ) in historyData.formHistoryDataDTO" :key="indexH">
							<!-- <h3 class="item">{{fistoryFormData.title}}</h3> -->
							<h3 class="item">
								<el-popover placement="top" trigger="hover">
									<div class="cell-content">{{ fistoryFormData.value }}</div>
									<p class="overflow" slot="reference">
										{{ fistoryFormData.value }}
									</p>
								</el-popover>
							</h3>
						</div>
					</div>
				</div>
			</template>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="historyVisible = false">关 闭</el-button>
			</span>
		</el-dialog>

		<el-dialog title="修改商品信息" :visible.sync="dialogDetailVisible" width="200" center>
			<el-form>
				<el-form-item label="商品名称">
					<el-input v-model="info.goodsName" />
				</el-form-item>
				<el-form-item label="商品来源">
					<el-select size="small" v-model="info.goodsSource" placeholder="请选择" filterable clearable>
						<el-option v-for="item in goodsSourceFilters" :key="item.value" :label="item.text"
							:value="item.value">
						</el-option>
					</el-select>
				</el-form-item>
				<el-form-item>
					<el-radio v-model="info.itemType" label="1">自营</el-radio>
					<el-radio v-model="info.itemType" label="2">撮合</el-radio>
				</el-form-item>
				<el-form-item>
					<el-radio v-model="info.isImport" label="国产">国产</el-radio>
					<el-radio v-model="info.isImport" label="进口">进口</el-radio>
				</el-form-item>
				<el-form-item label="税率">
					<el-input v-model="info.taxRate" />
				</el-form-item>
				<el-form-item label="规格">
					<el-input v-model="info.typeNo" />
				</el-form-item>
				<el-form-item label="销售单位">
					<el-input v-model="info.saleUnit" />
				</el-form-item>
				<el-form-item label="平台售价">
					<el-input v-model="info.goodsPrice">
						<template slot="prepend">含税</template>
					</el-input>
					<el-input v-model="info.excludeTaxPrice">
						<template slot="prepend">未税</template>
					</el-input>
				</el-form-item>
				<el-form-item label="协议价">
					<el-input v-model="info.agreementPrice">
						<template slot="prepend">含税</template>
					</el-input>
					<el-input v-model="info.initExcludeTaxPrice">
						<template slot="prepend">未税</template>
					</el-input>
				</el-form-item>
			</el-form>

			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogDetailVisible = false">取 消</el-button>
				<el-button type="primary" @click="save()">确 定</el-button>
			</span>
		</el-dialog>

		<el-dialog :title="detailTitle" :visible.sync="dialogDetailVisibleShow" width="80vw">
			<goodsInfoBox ref="info" :info="info" :disabel="true"></goodsInfoBox>
		</el-dialog>

		<el-dialog :title="goodsFailInfoTitle" :visible.sync="goodsFailVisible">
			<template solt="body">
				<el-form label-width="88px">
					<el-form-item label="驳回原因" prop="goodsName">
						<el-input v-model="goodsFailInfo" placeholder="请输入驳回原因" clearable size="small" clearable
							@keyup.enter.native="handleSearch" />
					</el-form-item>
					<el-form-item label="驳回原因" prop="brand">
						<el-select v-model="goodsFailInfo" filterable clearable remote size="small"
							:remote-method="remoteMethod" @change="changeBrand" placeholder="请输入关键词">
							<el-option label="商品分类错误" value="商品分类错误">商品分类错误</el-option>
							<el-option label="商品参数不全/错误" value="商品参数不全/错误">商品参数不全/错误</el-option>
							<el-option label="商品详情介绍过少" value="商品详情介绍过少">商品详情介绍过少</el-option>
							<el-option label="品牌信息错误" value="品牌信息错误">品牌信息错误</el-option>
							<el-option label="价格过高/平台已有价格更低同型号商品"
								value="价格过高/平台已有价格更低同型号商品">价格过高/平台已有价格更低同型号商品</el-option>
							<el-option label="商品图片不清晰/展示细节不全" value="商品图片不清晰/展示细节不全">商品图片不清晰/展示细节不全</el-option>
						</el-select>
					</el-form-item>
				</el-form>
			</template>

			<template slot="footer" class="dialog-footer">
				<el-button size="mini" type="text" @click="cancelGoodsFail">取消
				</el-button>
				<el-button size="mini" type="primary" @click="doGoodsFail">确认
				</el-button>
			</template>
		</el-dialog>
	</div>
</template>

<script>
	import {
		updateStock,
		rejectInfo,
		goodsInfo,
		goodsFail,
	} from "@/api/activiti/goods";
	import {
		queryGodCategoryZtreeAsyn
	} from "@/api/supplier.api";
	import {
		searchBrands,
		getBrand
	} from "@/api/brand.api";
	import {
		goodsList,
		goodsSave,
		goodsBatchDown,
		goodsDown
	} from "@/api/supplierActivity/goods.admin";
	import {
		supplierList
	} from "@/api/supplierActivity/supplier";
	import {
		categoryUser
	} from "@/api/activiti/goods";
	import {
		pushHistoryByGoodsId
	} from "@/api/supplierActivity/workflow";
	import {
		passAllByList
	} from "@/api/supplierActivity/goods.admin";
	import goodsInfoBox from "../components/goodsInfoBox";
	export default {
		name: "goodsItemAll",
		components: {
			goodsInfoBox,
		},
		data() {
			return {
				loading: false,
				goodsTableSelection: [],
				list: [],
				userList: {},
				supplierList: [],
				activityStatus: this.$config.activityStatus,
				activityFilters: this.$config.activityFilters,
				goodsSource: this.$config.goodsSource,
				goodsSourceFilters: this.$config.goodsSourceFilters,
				total: 0,
				info: {},
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					goodsName: undefined,
					supplierId: undefined,
					sku: undefined,
					activityStatus: undefined,
					goodsSource: undefined,
					primaryCategory: undefined,
					secondaryCategory: undefined,
					tertiaryCategory: undefined,
					brandId: undefined,
					goodsState: undefined,
				},
				primaryCategory: [],
				secondaryCategory: [],
				tertiaryCategory: [],
				brandList: [],
				dialogDetailVisible: false,
				historyVisible: false,
				fromDataArray: [],
				rejectInfoForm: {},
				detailTitle: "",
				dialogDetailVisibleShow: false,
				goodsFailVisible: false,
				goodsFailInfoTitle: "",
				goodsFailInfo: "",
			};
		},
		mounted() {
			this.getList();
			this.getUserList();
			this.getSupplierList();
			// 初始化分类列表
			this.primaryCategory = [];
			queryGodCategoryZtreeAsyn("", 1).then((res) => {
				this.primaryCategory = res;
			});
		},
		methods: {
			getList() {
				this.list = null;
				this.loading = true;
				goodsList(this.queryParams).then((res) => {
					this.list = res.rows;
					this.total = res.total;
					this.loading = false;
				});
			},
			getUserList() {
				categoryUser().then((res) => {
					res.rows.forEach((row) => {
						if (!this.userList[row.categoryId]) {
							const obj = {};
							obj.name = row.name;
							this.userList[row.categoryId] = obj;
						} else {
							const obj = this.userList[row.categoryId];
							obj.name = obj.name + "|" + row.name;
							this.userList[row.categoryId] = obj;
						}
					});
				});
			},
			getSupplierList() {
				supplierList().then((res) => {
					this.supplierList = res;
				});
			},
			handleQuery() {
				this.getList();
			},
			resetQuery() {
				this.$refs.searchForm.resetFields();
				this.getList();
			},
			changeSupplier() {
				this.$refs.goodsTable.clearSelection();
			},
			// 下架操作
			handleDown(row) {
				row.goodsState = "DOWN";
				goodsDown(row).then((res) => {
					this.$message.success("下架成功");
					this.getList();
				});
			},
			handleBatchDowm() {
				let passGoods = this.goodsTableSelection.filter(
					(item) => item.goodsState === "PASS"
				);
				const skus = passGoods.map((item) => item.sku).join(",");
				const supplierId = this.queryParams.supplierId;

				goodsBatchDown(skus, {
					supplierId
				}).then((res) => {
					console.log(res);
					this.$message.success("批量下架成功");
					this.resetQuery();
				});
			},
			handleSelectionChange(val) {
				this.goodsTableSelection = val;
			},
			handleDownForever(row) {
				row.goodsState = "DOWN";
				row.activityStatus = -1;
				goodsSave(row).then((res) => {
					this.$message.success("下架成功");
					this.getList();
				});
			},
			priceCalc(price) {
				if (price) return price.toFixed(2);
			},
			// 计算折扣率
			discountRateCalc(row) {
				const goodsPrice = row.agreementPrice;
				const officialPrice = row.officialPrice;
				if (goodsPrice == "" || goodsPrice == 0) {
					return "wait...";
				}
				if (
					officialPrice == "" ||
					officialPrice == 0 ||
					officialPrice == null ||
					officialPrice == undefined
				) {
					return "";
				}
				return (tools.accDiv(goodsPrice, officialPrice) * 100).toFixed(2) + "%";
			},
			changeGoodsSource(row) {
				this.info = row;
				this.dialogDetailVisible = true;
			},
			changeInfo(row) {
				this.info = row;
				this.dialogDetailVisible = true;
			},
			save() {
				goodsSave(this.info).then((res) => {
					this.$message.success("保存成功");
					this.dialogDetailVisible = false;
					this.getList();
				});
			},
			changeStock(row, currentValue, oldValue) {
				row.goodsStock = currentValue;
				updateStock(row).then((res) => {
					this.getList();
					this.$message.success({
						message: "更新库存成功！",
					});
				});
			},
			changePrimaryCategory(id) {
				this.queryParams.secondaryCategory = "";
				this.secondaryCategor = [];
				this.tertiaryCategory = [];
				queryGodCategoryZtreeAsyn(id, 1).then((res) => {
					this.secondaryCategory = res;
				});
				this.queryParams.tertiaryCategory = "";

				this.primaryCategory.map((row) => {
					if (row.id == id) {
						this.$nextTick(() => {
							this.queryParams.primaryCategory = row.id;
						});
					}
				});
			},
			changeSecondaryCategory(id) {
				this.queryParams.tertiaryCategory = "";
				this.tertiaryCategory = [];
				queryGodCategoryZtreeAsyn(id, 1).then((res) => {
					this.tertiaryCategory = res;
				});
				this.secondaryCategory.map((row) => {
					if (row.id == id) {
						this.$nextTick(() => {
							this.queryParams.secondaryCategory = row.id;
						});
					}
				});
			},
			changeTertiaryCategory(id) {
				this.tertiaryCategory.map((row) => {
					if (row.id == id) {
						this.$nextTick(() => {
							this.queryParams.tertiaryCategory = row.id;
						});
					}
				});
			},
			remoteMethod(query) {
				if (query !== "") {
					searchBrands(query).then((res) => {
						this.brandList = res;
					});
				}
			},
			changeBrand(brand) {},
			// 查看审批记录
			handleShowActivity(row) {
				rejectInfo(row.sku).then((res) => {
					this.rejectInfoForm = res;
					this.historyVisible = true;
				});
				pushHistoryByGoodsId(row.id).then((res) => {
					this.fromDataArray = res;
					this.historyVisible = true;
				});
			},
			showInfo(row) {
				this.info = {};
				this.dialogDetailVisibleShow = true;
				this.detailTitle = row.goodsName;
				goodsInfo(row.supplierId, row.sku).then((res) => {
					this.info = res;
					this.dialogLoading = false;
				});
			},
			handleGoodsFail(row) {
				this.goodsFailInfoTitle = `驳回商品${row.goodsName}`;
				this.info = row;
				this.goodsFailVisible = true;
			},
			remoteMethod(query) {
				if (query !== "") {
					searchBrands(query).then((res) => {
						this.brandList = res;
					});
				}
			},
			changeBrand(brand) {
				this.brandList.map((row) => {
					if (row.id == brand) {
						this.goodsInfo.brandName = row.showName;
						this.goodsInfo.brandCode = row.dcCode;
					}
				});
			},
			cancelGoodsFail() {
				this.goodsFailVisible = false;
				this.info = {};
			},
			doGoodsFail() {
				const row = this.info;
				var arr = Object.keys(row);
				if (this.goodsFailInfo == null || this.goodsFailInfo == "") {
					this.$message({
						type: "info",
						message: `请输入原因，驳回：${row.goodsName}`,
					});
					return;
				}
				goodsFail(row.supplierId, row.sku, this.goodsFailInfo).then((res) => {
					this.goodsFailVisible = false;
					this.$message.success({
						message: "驳回成功",
					});
					this.info = {};
					this.getList();
				});
			},
			passAll() {
				console.log(this.goodsTableSelection)
				passAllByList(this.goodsTableSelection).then(res => {
					this.$message.success(res)
				})
			}
		},
		watch: {
			dialogDetailVisible(value) {
				if (!value) this.info = {};
			},
		},
	};
</script>

<style lang="scss" scoped>
	.page-box {
		padding: 10px 0;
	}

	.price {
		color: #ff4d4f;
	}

	.true {
		color: #ff4d4f;
	}

	.goodsNameBox {
		overflow: hidden;
		max-width: 100%;
		white-space: nowrap;
		height: 25px;
		text-overflow: ellipsis;
	}

	.true {
		color: #ff4d4f;
		font-weight: 600;
	}

	.historyHead {
		background: #f5f7fa;
	}

	.historyList {
		width: 100%;
		overflow: hidden;
		border-left: 1px solid #ddd;
		border-bottom: 1px solid #ddd;

		.item {
			float: left;
			width: calc(100% / 6);
			border-right: 1px solid #ddd;
			height: 35px;
			line-height: 35px;
			text-align: center;
		}

		.item2 {
			float: left;
			width: calc(100% / 5);
			border-right: 1px solid #ddd;
			height: 35px;
			line-height: 35px;
			text-align: center;
		}
	}

	.el-dropdown-link {
		cursor: pointer;
		color: #ff4d4f;
		font-size: 12px;
	}

	::v-deep {
		.el-table__fixed-right {
			z-index: 9;
		}

		.el-dropdown-menu__item.is-disabled {
			.el-button--text {
				color: #bbb;
			}
		}
		.el-table .el-table__cell{
			padding:0px !important;
		}
	}
	.el-form-item{
		margin-bottom:0px;
	}
</style>